<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<script charset="utf-8" src="jslib/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript">
var editor;
$(function() {
	KindEditor.basePath = 'jslib/kindeditor/';
	KindEditor.create('textarea[name="describe"]',{
		afterChange: function (e) { this.sync(); },
		wellFormatMode : false
	});
	
	$("#moduls_fun_addCandidate_userId").combogrid({
		url : '${pageContext.request.contextPath}/userAction!queryUser.action',
		loadMsg : '数据加载中....',
		missingMessage : '请检索用户名',
		panelWidth : 440,
		panelHeight : 180,
		delay : 500,
		fitColumns : true,
		value : '',
		idField : 'userId',
		textField : 'userRealName',
		mode : 'remote',
		pagination : true,
		missingMessage:'请检索用户编号!',
		pageSize : 5,
		pageList : [ 5, 10 ],
		columns : [ [ {
			title : '编号',
			field : 'userId',
			width : 150,
			hidden : true
		}, {
			title : '工号',
			field : 'username',
			width : 80
		}, {
			title : '用户姓名',
			field : 'userRealName',
			width : 80
		}, {
			title : '所在组ID',
			field : 'groupId',
			width : 100,
			formatter : function(value, row, index) {
				if (value == 0)
					return '';
				return row.groupName;
			}
		}, {
			title : '角色ID',
			field : 'roleId',
			width : 100,
			formatter : function(value, row, index) {
				if (value == 0)
					return '';
				return row.roleName;
			}
		} ] ],
		onHidePanel : function(newValue, oldValue) {
			var username = $("#moduls_fun_addCandidate_userId").combogrid('getText');
			$("#moduls_fun_addCandidate_addForm #username").val(username);
		},
		onLoadSuccess : function(data) {
			if (data.rows.length == 1) {
				$(this).combogrid("grid").datagrid('selectRow', 0);
			}
		}
	});
});
</script>
<div align="center">
<br/>
	<form id="moduls_fun_addCandidate_addForm" method="post" enctype="multipart/form-data">
		<table class="tableForm">
			<tr>
				<th style="width: 100px;font-size: 12px; font-weight: normal;">姓名</th>
				<td>
				<select id="moduls_fun_addCandidate_userId" name="userId" data-options="required:true" style="width:150px;"></select>
				<input name="username" id="username" type="hidden" />
				</td>
				<th style="width: 100px;font-size: 12px; font-weight: normal;"></th>
				<td></td>
			</tr>
			<tr>
				<th style="width: 60px;font-size: 12px; font-weight: normal;">职务</th>
				<td><input name="job" class="easyui-validatebox" data-options="required:true" /></td>
				<th style="width: 60px;font-size: 12px; font-weight: normal;">评选种类</th>
				<td><select id="catId" name="catId" class="easyui-combobox" data-options="required:true,valueField:'catId', textField:'name', url:'categoryAction!query.action'" style="width:200px;">
				</select>
				</td>
			</tr>	
			<tr>
				<th style="width: 100px;font-size: 12px; font-weight: normal;">头像</th>
				<td><input type="file" name="picture">
				</td>
				<th style="width: 100px;font-size: 12px; font-weight: normal;">材料</th>
				<td><input type="file" name="info"></td>
			</tr>		
		</table>
		<div style="height: 30px;"></div>
		<div><div style="text-align: left;width:760px;">描述</div>
		<textarea name="describe" style="width:760px;height:400px;visibility:hidden;"></textarea>
		</div>
	</form>
</div>